﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Data.OleDb;

namespace DotNETX.Authentication.Db.Access
{
    public static class ConnectionUtils
    {
        public static IDbConnection CreateAccessConnectionByFile(string file)
        {
            return new OleDbConnection(string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};", file));
        }

        public static IDbConnection CreateAccessConnectionByFile(string provider, string file)
        {
            return new OleDbConnection(string.Format("Provider={0};Data Source={1};", provider, file));
        }

        public static IDbConnection CreateAccessConnection(string connectionString)
        {
            return new OleDbConnection(connectionString);
        }
    }
}
